package com.coolham.switter.db;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

public class AbstractTable implements ITable {
	final static String TAG = "AbstractTable";
	
	protected ConnectionProvider mConn = null;
	protected volatile boolean bCreated = false;
	protected byte[] lock = new byte[0];

	public AbstractTable(Context ct) {
		mConn = new ConnectionProvider(ct);
		//Log.v(TAG, "!!!!  mConn=" + mConn.hashCode());
	}
	
	public void close() {
		mConn.closeConnection();
	}

	public void createTable(String createSQL) {
		SQLiteDatabase db = mConn.getConnection();
		db.execSQL(createSQL);
		
	}

	public boolean isTableExits(String tableName) {
		return mConn.isTableExits(tableName);
	}
}
